//#include "fwShader.h"
//
//Shader::Shader()
//{
//	Position = -1;
//	Color = -1;
//	Coordinate = -1;
//	Normal = -1;
//	BiNormal = -1;
//	Tangent = -1;
//	MatrixLocal = -1;
//	MatrixWVP = -1;
//	CubeSampler = -1;
//	for (int i = 0; i < 10; i++)
//		Samplers[i] = -1;
//
//	ProgramObject = 0;
//	m_vertexShader = 0;
//	m_fragmentShader = 0;
//}
//
//FWint Shader::Init(FWuint count, char** value)
//{
//	//Khong du du lieu de khoi tao shader
//	if (count != 2)
//		return -1;
//
//	//Tao vertex shader
//	char* src = ShaderHelper::ReadShader(value[0]);
//	m_vertexShader = ShaderHelper::LoadShader(GL_VERTEX_SHADER, src);
//	SAFE_DEL_ARRAY(src);
//	//Khong khoi tao duoc shader
//	if (m_vertexShader == 0)
//		return -2;
//
//	//Tao fragment shader
//	src = ShaderHelper::ReadShader(value[1]);
//	m_fragmentShader = ShaderHelper::LoadShader(GL_FRAGMENT_SHADER, src);
//	SAFE_DEL_ARRAY(src);
//	//Khong khoi tao duoc shader
//	if (m_fragmentShader == 0)
//	{
//		glDeleteShader(m_vertexShader);
//		return -2;
//	}
//
//	ProgramObject = ShaderHelper::LoadProgram(m_vertexShader, m_fragmentShader);
//	if (ProgramObject == 0)
//	{
//		glDeleteShader(m_vertexShader);
//		glDeleteShader(m_fragmentShader);
//		return -2;
//	}
//
//	Load();
//
//	return 0;
//}
//
//void Shader::Destroy()
//{
//	glDeleteShader(m_vertexShader);
//	glDeleteShader(m_fragmentShader);
//	glDeleteProgram(ProgramObject);
//}
//
//void Shader::Load()
//{
//	Position = glGetAttribLocation(ProgramObject, "a_PosL");
//	Color = glGetAttribLocation(ProgramObject, "a_ColorL");
//	Coordinate = glGetAttribLocation(ProgramObject, "a_UV");
//	Normal = glGetAttribLocation(ProgramObject, "a_Normal");
//	BiNormal = glGetAttribLocation(ProgramObject, "a_BiNormal");
//	Tangent = glGetAttribLocation(ProgramObject, "a_TGT");
//
//	MatrixLocal = glGetUniformLocation(ProgramObject, "u_MatrixL");
//	MatrixWVP = glGetUniformLocation(ProgramObject, "u_MatrixWVP");
//
//	CubeSampler = glGetUniformLocation(ProgramObject, "u_SamplerCube");
//	Samplers[0] = glGetUniformLocation(ProgramObject, "u_Sampler0");
//	Samplers[1] = glGetUniformLocation(ProgramObject, "u_Sampler1");
//	Samplers[2] = glGetUniformLocation(ProgramObject, "u_Sampler2");
//	Samplers[3] = glGetUniformLocation(ProgramObject, "u_Sampler3");
//	Samplers[4] = glGetUniformLocation(ProgramObject, "u_Sampler4");
//	Samplers[5] = glGetUniformLocation(ProgramObject, "u_Sampler5");
//	Samplers[6] = glGetUniformLocation(ProgramObject, "u_Sampler6");
//	Samplers[7] = glGetUniformLocation(ProgramObject, "s_SamplerNormal");
//	Samplers[8] = glGetUniformLocation(ProgramObject, "s_SamplerLighting");
//	Samplers[9] = glGetUniformLocation(ProgramObject, "s_SamplerShadow");
//
//}